package com.wut.easyexcel.common;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.text.StrPool;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import java.util.Set;
import lombok.Data;

/**
 * Excel基础类
 */
@Data
@ExcelIgnoreUnannotated
public class BaseExcel {

    private Integer rowNumber;

    private Set<String> failedMassageSet;

    @ExcelProperty("失败原因")
    private String failedMessage;

    public String getFailedMessage() {
        if (CollUtil.isNotEmpty(failedMassageSet)) {
            return String.join(StrPool.CRLF, failedMassageSet);
        }
        return StrUtil.EMPTY;
    }
}
